﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：IIocResolver.cs
// 功能描述：TongTongMall
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TongTongMall.Dependecy
{
    public interface IIocResolver
    {
        /// <summary>
        /// 从ioc内获取实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T Resolve<T>();

        /// <summary>
        /// 从ioc内获取实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T Resolve<T>(Type type);

        /// <summary>
        /// 从ioc内获取实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T Resolve<T>(object argumentsAsAnonymousType);

        /// <summary>
        /// 从ioc内获取实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        object Resolve(Type type);

        /// <summary>
        /// 从ioc内获取实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        object Resolve(Type type, object argumentsAsAnonymousType);

        /// <summary>
        /// 从ioc内获取实例
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        void Release(object obj);

        /// <summary>
        /// 从ioc内判断是否注册
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        bool IsRegistered(Type type);

        /// <summary>
        /// 从ioc内判断是否注册
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        bool IsRegistered<T>();
    }
}
